home *** CD-ROM | disk | FTP | other *** search
/ Programmer Plus 2007 / Programmer-Plus-2007.iso / Programming / XML Utilities / Professional Programmer XSL IDE / Xselerator25.msi / Data.Cab / F29840_partition.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2001-10-28  |  1.4 KB  |  43 lines

  1. <xsl:stylesheet version="1.0" 
  2. xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:msxsl="urn:schemas-microsoft-com:xslt"
  4. >
  5.  
  6.   <xsl:import href="map.xsl"/>
  7.   
  8.   
  9.   <xsl:template name="partition">
  10.     <xsl:param name="pList" select="/.."/>
  11.     <xsl:param name="pController" select="/.."/>
  12.     <xsl:param name="pContollerParam" select="/.."/>
  13.     <xsl:param name="pParam0" select="/.."/>
  14.     <xsl:param name="pElementName" select="'list'"/>
  15.     
  16.     <xsl:variable name="vHoldsListRTF">
  17.       <xsl:call-template name="map">
  18.           <xsl:with-param name="pFun" select="$pController"/>
  19.           <xsl:with-param name="pList1" select="$pList"/>
  20.       </xsl:call-template>
  21.     </xsl:variable>
  22.     
  23.     <xsl:variable name="vHoldsList" select="msxsl:node-set($vHoldsListRTF)/*"/>
  24.     
  25.     <xsl:element name="{$pElementName}">
  26.       <xsl:for-each select="$vHoldsList">
  27.         <xsl:variable name="vPosition" select="position()"/>
  28.         <xsl:if test="string(.)">
  29.           <xsl:copy-of select="$pList[position()=$vPosition]"/>
  30.         </xsl:if>
  31.       </xsl:for-each>
  32.     </xsl:element>
  33.     
  34.     <xsl:element name="{$pElementName}">
  35.       <xsl:for-each select="$vHoldsList">
  36.         <xsl:variable name="vPosition" select="position()"/>
  37.         <xsl:if test="not(string(.))">
  38.           <xsl:copy-of select="$pList[position()=$vPosition]"/>
  39.         </xsl:if>
  40.       </xsl:for-each>
  41.     </xsl:element>
  42.   </xsl:template>
  43. </xsl:stylesheet>